home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / text / mac / faqs.353 < prev    next >
Encoding:
Text File  |  1996-02-12  |  28.0 KB  |  533 lines

  1. Frequently Asked Questions (FAQS);faqs.353
  2.  
  3.  
  4.  
  5. ----------------------------------------------------------------
  6.  
  7. ;;; ********************************
  8. ;;; Change Log *********************
  9. ;;; ********************************
  10. ;;; Date      Who     Ver   Reason
  11. ;;; ------------------------------------------------------------
  12. ;;;  7-FEB-92 mk      1.0   Initial release.
  13. ;;; 10-FEB-92 mk      1.1   Pre-release corrections and additions.
  14. ;;; 10-FEB-92 mk      1.11  Minor changes from Arun Welch, Mitch Marks,
  15. ;;;                         Mike Meyer, Matthias Felleisen, and John Gateley.
  16. ;;; 11-FEB-92 mk      1.12  Corrections by John Carroll, Jason Trenouth, Joel
  17. ;;;                         Riedesel, David Neves, Lawrence Mayka and
  18. ;;;                         Bruce Miller.
  19. ;;; 13-FEB-92 mk      1.13  Renumbering. Split into 3 files. Some more FAQs.
  20. ;;; 23-MAR-92 mk      1.14  Updated various FTP entries, bug in EXPLODE.
  21. ;;;                         Updated harlequin entry.
  22. ;;; 25-MAR-92 mk      1.15  Added question [2-18]: saving data and CLOS
  23. ;;;                         instances to disk for later retrieval.
  24. ;;;  1-MAY-92 mk      1.17  Added entry for Feel to question [1-5]. Updated CMU
  25. ;;;                         ftp machines to point to ftp.cs.cmu.edu. Fixed CMU
  26. ;;;                         CL entry to be approximately version independent.
  27. ;;;                         Revised entry on Garnet. uunet.uu.net -> ftp.uu.net
  28. ;;; 12-MAY-92 mk      1.18  Split questions 1-5, 1-6, and 1-7 into part 4,
  29. ;;;                         which is now cross-posted to comp.lang.scheme, and
  30. ;;;                         questions 1-8, 2-3, 2-9 and 2-18 into part 5 which
  31. ;;;                         is now cross-posted to comp.lang.clos.
  32. ;;;                         Added detail to Norvig entry in 1-1.
  33. ;;;                         Updated entries for several Lisp implementations.
  34. ;;; 26-MAY-92 mk      1.19  Changed 5-2 on the basis of comments by Jeff Greif.
  35. ;;; 29-MAY-92 mk      1.20  Added question [2-17] about lisp sockets.
  36. ;;; 16-JUN-92 mk      1.21  Moved the question about object oriented
  37. ;;;                         programming references to part 5 of the FAQ.
  38. ;;;                         Entry on Dylan. Addition to MIT Scheme entry
  39. ;;;                         regarding Schematik.
  40. ;;; 22-JUN-92 mk            Updated SOAR entry.
  41. ;;; 24-JUN-92 mk            Fixed MCL entry to note that CLIM is available
  42. ;;;                         from ILA, not via Apple.
  43. ;;; 25-JUN-92 mk      1.22  Added question [2-18].
  44. ;;; 17-JUL-92 mk            Added entry on PSD (Portable Scheme Debugger).
  45. ;;; 20-JUL-92 mk            Updated entry on T3.1
  46. ;;; 30-JUL-92 mk            Added entry on XIT to question 2-2.
  47. ;;;  3-AUG-92 mk            Updated PC-Scheme entry (bought by Ibuki).
  48. ;;;  6-AUG-92 mk      1.23  Merged in Jeff Dalton's pitfalls list.
  49. ;;; 19-AUG-92 mk            Added entry on FOCL. Move three questions from
  50. ;;;                         part 2 to part 3, to keep part 2 under 64k.
  51. ;;; 26-AUG-92 mk            Added some items from Hallvard Tretteberg's
  52. ;;;                         Lisp style guide.
  53. ;;; 31-AUG-92 mk      1.24  Updated entries for CMU CL and SIOD.
  54. ;;;  8-SEP-92 mk            Added entry on VSCM to part 4. Added entry on
  55. ;;;                         Pixie Scheme, Help, and Le-Lisp.
  56. ;;; 14-SEP-92 mk            Fixed Symbolics entry. Added entry on CLIM-library.
  57. ;;; 15-SEP-92 mk            Updated MIT C-Scheme entry.
  58. ;;; 17-SEP-92 mk            Added entry on Lisp-Jobs. Fixed Le-Lisp entry.
  59. ;;;                         Added 3-15.
  60. ;;; 23-SEP-92 mk            Added entry on COLAB to ftp resources.
  61. ;;;                         Added entry on WCL to Part 4.
  62. ;;; 30-SEP-92 mk            Added entry on Dr. Dobb's lisp-style C extensions.
  63. ;;;                         Updated entry on Friedman/Wand/Haynes' book.
  64. ;;;  9-OCT-92 mk      1.25  Updated Chez Scheme entry.
  65. ;;;                         Added entry on extracting the function name from
  66. ;;;                         the function object, provided by Kerry Koitzsch.
  67. ;;; 14-OCT-92 mk      1.26  Split off the ftp resources question from Part 2
  68. ;;;                         into its own file, now labels Part 6.
  69. ;;;                         Broke up the question into smaller pieces
  70. ;;;                         and reorganized it too. Reorganized Part 4.
  71. ;;; 20-OCT-92 mk            Added description of Koschmann text,
  72. ;;;                         thanks to L. Mayka.
  73. ;;; 27-OCT-92 mk      1.27  Added question 6-6 about formatting code in LaTeX.
  74. ;;;  3-NOV-92 mk            Added comment on file modularization to 1-2.
  75. ;;;                         Added note on the CLOS code repository to
  76. ;;;                         6-1.
  77. ;;;  5-NOV-92 mk            Added info on Lucid benchmark programs in the
  78. ;;;                         goodies/ directory. Also the Lucid
  79. ;;;                         wizards.doc file.
  80. ;;; 11-NOV-92 mk    Added entry on Karlsruhe CLISP to 4-0.
  81. ;;; 13-NOV-92 mk    Added entry on ARS MAGNA to part 6, subsection Planning
  82. ;;;                 Testbeds.
  83. ;;; 17-NOV-92 mk    Added entry on GECO and GAL to 6-3.
  84. ;;; 17-NOV-92 mk    Updated prices in Allegro CL entry.
  85. ;;; 24-NOV-92 mk    Added entry on the automatic memoization facility
  86. ;;;                 to part 6.
  87. ;;; ------------------------------------------------------------
  88.  
  89. ;;; *EOF*
  90. Xref: bloom-picayune.mit.edu comp.lang.lisp:8750 news.answers:4560
  91. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!spool.mu.edu!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!mkant
  92. From: mkant+@cs.cmu.edu (Mark Kantrowitz)
  93. Newsgroups: comp.lang.lisp,news.answers
  94. Subject: FAQ: Lisp Frequently Asked Questions 2/6 [Monthly posting]
  95. Summary: Frequently asked questions about Lisp -- General Questions
  96. Message-ID: <lisp-faq-2.text_724237288@cs.cmu.edu>
  97. Date: 13 Dec 92 09:01:37 GMT
  98. Article-I.D.: cs.lisp-faq-2.text_724237288
  99. Expires: Tue, 26 Jan 1993 09:01:28 GMT
  100. Sender: news@cs.cmu.edu (Usenet News System)
  101. Reply-To: lisp-faq@think.com
  102. Followup-To: poster
  103. Organization: School of Computer Science, Carnegie Mellon
  104. Lines: 546
  105. Approved: news-answers-request@MIT.Edu
  106. Supersedes: <lisp-faq-2.text_721645310@cs.cmu.edu>
  107. Nntp-Posting-Host: a.gp.cs.cmu.edu
  108.  
  109. Archive-name: lisp-faq/part2
  110. Last-Modified: Thu Nov  5 19:30:40 1992 by Mark Kantrowitz
  111. Version: 1.27
  112.  
  113. ;;; ****************************************************************
  114. ;;; Answers to Frequently Asked Questions about Lisp ***************
  115. ;;; ****************************************************************
  116. ;;; Written by Mark Kantrowitz and Barry Margolin
  117. ;;; lisp-faq-2.text -- 28371 bytes
  118.  
  119. This post contains Part 2 of the Lisp FAQ.
  120.  
  121. If you think of questions that are appropriate for this FAQ, or would
  122. like to improve an answer, please send email to us at lisp-faq@think.com.
  123.  
  124. Topics Covered (Part 2):
  125.  
  126.   [2-1]   Is there a GNU-Emacs interface to Lisp?
  127.   [2-3]   What is the equivalent of EXPLODE and IMPLODE in Common Lisp?
  128.   [2-4]   Is Lisp inherently slower than more conventional languages such as C?
  129.   [2-5]   Why does Common Lisp have "#'"?
  130.   [2-6]   How do I call non-Lisp functions from Lisp?
  131.   [2-7]   Can I call Lisp functions from other languages?
  132.   [2-8]   I want to call a function in a package that might not exist at
  133.           compile time. How do I do this?
  134.   [2-9]   What is CDR-coding?
  135.   [2-10]  What is garbage collection?
  136.   [2-11]  How do I save an executable image of my loaded Lisp system?
  137.           How do I run a Unix command in my Lisp?
  138.           How do I get the current directory name from within a Lisp program?
  139.   [2-12]  I'm porting some code from a Symbolics Lisp machine to some
  140.           other platform, and there are strange characters in the code.
  141.           What do they mean?
  142.   [2-13]  History: Where did Lisp come from?
  143.   [2-14]  How do I find the argument list of a function?
  144.           How do I get the function name from a function object?
  145.   [2-15]  How can I have two Lisp processes communicate via unix sockets?
  146.  
  147. Search for [#] to get to question number # quickly.
  148.  
  149. ----------------------------------------------------------------
  150. [2-1] Is there a GNU-Emacs interface to Lisp?
  151.  
  152. ILISP is a powerful GNU-Emacs interface to many dialects of
  153. Lisp, including Lucid, Allegro, {A}KCL, IBCL, and CMU. Written by
  154. Chris McConnell <ccm+@cs.cmu.edu>. It is available by anonymous
  155. ftp from katmandu.mt.cs.cmu.edu [128.2.250.68] in the directory
  156. pub/ilisp as the file ilisp.tar.Z. If you start using it, send
  157. Chris mail, as he maintains a mailing list of users.
  158.  
  159. Franz Inc.'s GNU-Emacs/Lisp interface includes an online Common
  160. Lisp manual. It is available by license from Franz Inc. Contact
  161. info@franz.com for more information. There is also a mailing list,
  162. lisp-emacs-forum-request@ucbarpa.berkeley.edu.
  163.  
  164. The cl-shell package provides a major mode (cl-shell-mode) for running
  165. Common Lisp (CL) as an Emacs subprocess.  It provides a general
  166. mechanism for communication between CL and Emacs which does not rely
  167. on extra processes, and should therefore be easily portable to any
  168. version of CL.  Features include direct (i.e., not through a temp file)
  169. evaluation and in-package compilation of forms from lisp-mode buffers,
  170. type-ahead and a history mechanism for the cl-shell buffer, and pop-up
  171. help facilities for the CL functions documentation, macroexpand and
  172. describe.  Extensions for Lucid Common Lisp provide pop-up arglists
  173. and source file editing.  Other extensions are provided to allow
  174. editing source files of CLOS or Flavors methods.  Cl-shell is
  175. available on the Lucid tape (in the goodies directory) or via
  176. anonymous ftp from whitechapel.media.mit.edu (18.85.0.125).
  177.  
  178. Lucid includes some other Emacs-Lisp interfaces in its goodies directory.
  179.  
  180. Harlequin's LispWorks includes an Emacs-Lisp interface.
  181.  
  182. Venue's Medley has an optional EMACS Interface.
  183.  
  184. GNU-Emacs itself is available by anonymous ftp from prep.ai.mit.edu.
  185.  
  186. ----------------------------------------------------------------
  187. [2-3] What is the equivalent of EXPLODE and IMPLODE in Common Lisp?
  188.  
  189. Hopefully, the only reason you need to do this is as part of trying to port
  190. some old MacLisp code to Common Lisp.  These functions predated the
  191. inclusion of strings as a first-class data type in Lisp; symbols were used
  192. as strings, and they ere EXPLODEd to allow the individual characters to be
  193. manipulated in a list.
  194.  
  195. Probably the best approximations of these are:
  196.  
  197.    (defun explode (object)
  198.      (loop for char across (prin1-to-string object)
  199.            collect (intern (string char))))
  200.  
  201.    (defun implode (list)
  202.      (read-from-string (coerce (mapcar #'character list) 'string)))
  203.  
  204. An alternate definition of EXPLODE which uses MAP instead of LOOP is:
  205.  
  206.    (defun explode (object)
  207.      (map 'list #'(lambda (char)
  208.                     (intern (string char)))
  209.           (prin1-to-string object)))
  210.  
  211. The creation of N conses of garbage to process a string of N
  212. characters is a hideously inefficient way of doing the job.  Rewrite
  213. EXPLODE code with PRIN1-TO-STRING, or better STRING if the arguments
  214. are symbols without funny characters.  For IMPLODE, try to make its
  215. caller use strings and try to make the result usable as a string to
  216. avoid having to call INTERN or READ-FROM-STRING.
  217.  
  218. ----------------------------------------------------------------
  219. [2-4] Is Lisp inherently slower than more conventional languages such as C?
  220.  
  221. This is a tough question to answer, as I'm sure you expected.  In many
  222. cases, it appears to be.  Lisp does not require the programmer to specify
  223. the data type of variables, so generic arithmetic operators may have to
  224. perform type checking at runtime in order to determine how to proceed.
  225. However, Lisp code can also be denser (i.e.  there is more expressed in a
  226. single line) than many other languages: the Lisp expression (+ A B) is more
  227. powerful than the C expression A+B (the Lisp version supports bignums,
  228. rationals, and complex numbers, while the C version only supports
  229. limited-size integers and floating point); therefore, one may claim that it
  230. is reasonable that the Lisp version take longer than the C version (but
  231. don't expect everyone to accept this rationalization).  Solutions to this
  232. include hardware support (e.g. processors that support type tags in data,
  233. such as SPARC and Symbolics Lisp Machines), declarations, and specialized
  234. variants of functions (e.g. in MacLisp, + accepts and returns only fixnums,
  235. +$ accepts and returns only flonums, and PLUS is generic).
  236.  
  237. At one time, the MIT PDP-10 MacLisp compiler was compared to DEC's PDP-10
  238. Fortran compiler.  When appropriate declarations were supplied in the Lisp
  239. code, the performance of compiled Lisp arithmetic rivaled that of the
  240. Fortran code.  It would hardly be fair to compare Lisp without declarations
  241. to Fortran, since the Fortran compiler would have more information upon
  242. which it could base its optimizations.
  243.  
  244. Since Lisp is a good language for rapid prototyping, it is easy for a
  245. mediocre programmer (or even a good programmer, who isn't being careful) to
  246. generate a large amount of inefficient Lisp code. A good example is the use
  247. of APPEND to link successive lists together, instead of keeping a pointer
  248. to the tail of the list. Often a programmer can obtain significant
  249. speed increases by using a time/space profiler to identify the
  250. functions which waste time (often small functions which are called
  251. frequently) and rewriting those functions.
  252.  
  253. ----------------------------------------------------------------
  254. [2-5] Why does Common Lisp have "#'"?
  255.  
  256. #' is a macro-character which expands #'FOO to (FUNCTION FOO).  Symbols in
  257. Lisp have two bindings, one for values and one for functions, allowing them
  258. to represent both variables and functions, depending on context. #'FOO
  259. accesses FOO's lexical function binding in a context where the value
  260. interpretation would normally occur.  #' is also used to create lexical
  261. closures for lambda expressions. A lexical closure is a function which when
  262. invoked executes the body of the lambda-expression in the lexical
  263. environment within which the closure was created.  See pp. 115-117 of CLtL2
  264. for more details.
  265.  
  266. ----------------------------------------------------------------
  267. [2-6] How do I call non-Lisp functions from Lisp?
  268.  
  269. Most Lisp implementations for systems where Lisp is not the most common
  270. language provide a "foreign function" interface.  As of now there has been
  271. no significant standardization effort in this area.  They tend to be
  272. similar, but there are enough differences that it would be inappropriate to
  273. try to describe them all here.  In general, one uses an
  274. implementation-dependent macro that defines a Lisp function, but instead of
  275. supplying a body for the function, one supplies the name of a function written
  276. in another language; the argument list portion of the definition is
  277. generally augmented with the data types the foreign function expects and
  278. the data type of the foreign function's return value, and the Lisp
  279. interface function arranges to do any necessary conversions.  There is also
  280. generally a function to "load" an object file or library compiled in a
  281. foreign language, which dynamically links the functions in the file being
  282. loaded into the address space of the Lisp process, and connects the
  283. interface functions to the corresponding foreign functions.
  284.  
  285. If you need to do this, see the manual for your language implementation for
  286. full details.  In particular, be on the lookout for restrictions on the
  287. data types that may be passed.  You may also need to know details about the
  288. linkage conventions that are used on your system; for instance, many C
  289. implementations prepend an underscore onto the names of C functions when
  290. generating the assembler output (this allows them to use names without
  291. initial underscores internally as labels without worrying about conflicts),
  292. and the foreign function interface may require you to specify this form
  293. explicitly.
  294.  
  295. Franz Allegro Common Lisp's "Foreign Function Call Facility" is
  296. described in chapter 10 of the documentation. Calling Lisp Functions
  297. from C is treated in section 10.8.2. The foreign function interface in
  298. Macintosh Common Lisp is similar. The foreign function interface for
  299. KCL is described in chapter 10 of the KCL Report. The foreign function
  300. interfaces for Lucid on the Vax and Lucid on the Sun4 are
  301. incompatible. Lucid's interface is described in chapter 5 of the
  302. Advanced User's Guide.
  303.  
  304. ----------------------------------------------------------------
  305. [2-7] Can I call Lisp functions from other languages?
  306.  
  307. In implementations that provide a foreign function interface as described
  308. above, there is also usually a "callback" mechanism.  The programmer may
  309. associate a foreign language function name with a Lisp function.  When a
  310. foreign object file or library is loaded into the Lisp address space, it is
  311. linked with these callback functions.  As with foreign functions, the
  312. programmer must supply the argument and result data types so that Lisp may
  313. perform conversions at the interface. Note that in such foreign function
  314. interfaces Lisp is often left "in control" of things like memory
  315. allocation, I/O channels, and startup code (this is a major nuisance
  316. for lots of people).
  317.  
  318. ----------------------------------------------------------------
  319.  
  320. [2-8]  I want to call a function in a package that might not exist at
  321.        compile time. How do I do this?
  322.  
  323. Use (funcall (find-symbol "SYMBOL-NAME" :pkg-name) ...).
  324.  
  325. ----------------------------------------------------------------
  326. [2-9]  What is CDR-coding?
  327.  
  328. CDR-coding is a space-saving way to store lists in memory.  It is normally
  329. only used in Lisp implementations that run on processors that are
  330. specialized for Lisp, as it is difficult to implement efficiently
  331. in software.  In normal list structure, each element of the
  332. list is represented as a CONS cell, which is basically two pointers (the
  333. CAR and CDR); the CAR points to the element of the list, while the CDR
  334. points to the next CONS cell in the list or NIL.  CDR-coding takes
  335. advantage of the fact that most CDR cells point to another CONS, and
  336. further that the entire list is often allocated at once (e.g. by a call to
  337. LIST).  Instead of using two pointers to implement each CONS cell, the CAR
  338. cell contains a pointer and a two-bit "CDR code".  The CDR code may contain
  339. one of three values: CDR-NORMAL, CDR-NEXT, and CDR-NIL.  If the code is
  340. CDR-NORMAL, this cell is the first half of an ordinary CONS cell pair, and
  341. the next cell in memory contains the CDR pointer as described above.  If
  342. the CDR code is CDR-NEXT, the next cell in memory contains the next CAR
  343. cell; in other words, the CDR pointer is implicitly thisaddress+1, where
  344. thisaddress is the memory address of the CAR cell.  If the CDR code is
  345. CDR-NIL, then this cell is the last element of the list; the CDR pointer is
  346. implicitly a reference to the object NIL.  When a list is constructed
  347. incrementally using CONS, a chain of ordinary pairs is created; however,
  348. when a list is constructed in one step using LIST or MAKE-LIST, a block of
  349. memory can be allocated for all the CAR cells, and their CDR codes all set
  350. to CDR-NEXT (except the last, which is CDR-NIL), and the list will only
  351. take half as much storage (because all the CDR pointers are implicit).
  352.  
  353. If this were all there were to it, it would not be difficult to implement
  354. in software on ordinary processors; it would add a small amount of overhead
  355. to the CDR function, but the reduction in paging might make up for it.  The
  356. problem arises when a program uses RPLACD on a CONS cell that has a CDR
  357. code of CDR-NEXT or CDR-NIL.  Normally RPLACD simply stores into the CDR
  358. cell of a CONS, but in this case there is no CDR cell -- its contents are
  359. implicitly specified by the CDR code, and the word that would normally
  360. contain the CDR pointer contains the next CONS cell (in the CDR-NEXT case)
  361. to which other data structures may have pointers, or the first word of some
  362. other object (in the CDR-NIL case).  When CDR-coding is used, the
  363. implementation must also provide automatic "forwarding pointers"; an
  364. ordinary CONS cell is allocated, the CAR of the original cell is copied
  365. into its CAR, the value being RPLACD'ed is stored into its CDR, and the old
  366. CAR cell is replaced with a forwarding pointer to the new CONS cell.
  367. Whenever CAR or CDR is performed on a CONS, it must check whether the
  368. location contains a forwarding pointer.  This overhead on both CAR and CDR,
  369. coupled with the overhead on CDR to check for CDR codes, is generally
  370. enough that using CDR codes on conventional hardware is infeasible.
  371.  
  372. There is some evidence that CDR-coding doesn't really save very much
  373. memory, because most lists aren't constructed at once, or RPLACD is done on
  374. them enough that they don't stay contiguous.  At best this technique can
  375. save 50% of the space occupied by CONS cells. However, the savings probably
  376. depends to some extent upon the amount of support the implementation
  377. provides for creating CDR-coded lists.  For instance, many system functions
  378. on Symbolics Lisp Machines that operate on lists have a :LOCALIZE option;
  379. when :LOCALIZE T is specified, the list is first modified and then copied
  380. to a new, CDR-coded block, with all the old cells replaced with forwarding
  381. pointers.  The next time the garbage collector runs, all the forwarding
  382. pointers will be spliced out.  Thus, at a cost of a temporary increase in
  383. memory usage, overall memory usage is generally reduced because more lists
  384. may be CDR-coded. There may also be some benefit in improved paging
  385. performance due to increased locality as well (putting a list into
  386. CDR-coded form makes all the "cells" contiguous). Nevertheless, modern
  387. Lisps tend to use lists much less frequently, with a much heavier
  388. reliance upon code, strings, and vectors (structures).
  389.  
  390. ----------------------------------------------------------------
  391. [2-10] What is garbage collection?
  392.  
  393. Garbage Collection (GC) refers to the automatic storage allocation
  394. mechanisms present in many Lisps. There are several kinds of storage
  395. allocation algorithms, but most fall within two main classes:
  396.  
  397.    1. Stop and Copy. Systems which copy active objects from "old"
  398.       storage to "new" storage and then recycle the old storage.
  399.  
  400.    2. Mark and Sweep. Systems which link together storage
  401.       used by discarded objects.
  402.  
  403. Generational scavenging garbage collection (aka emphemeral GC) is a
  404. variation in which memory is allocated in layers, with tenured
  405. (long-lived) objects in the older layers. Rather than doing a full GC
  406. of all of memory every time more room is needed, only the last few
  407. layers are GCed during an ephemeral GC, taking much less time.
  408. Short-lived objects are quickly recycled, and full GCs are then much
  409. less frequent. It is most often used to improve the performance of
  410. stop and copy garbage collectors.  It is possible to implement
  411. ephemeral GC in mark and sweep systems, just much more difficult.
  412.  
  413. Stop and copy garbage collection provides simpler storage allocation,
  414. avoids fragmentation of memory (intermixing of free storage with used
  415. storage). Copying, however, consumes more of the address space, since up to
  416. half the space must be kept available for copying all the active objects.
  417. This makes stop and copy GC impractical for systems with a small address
  418. space or without virtual memory.  Also, copying an object requires that you
  419. track down all the pointers to an object and update them to reflect the new
  420. address, while in a non-copying system you need only keep one pointer to an
  421. object, since its location will not change. It is also more difficult to
  422. explicitly return storage to free space in a copying system.
  423.  
  424. Garbage collection is not part of the Common Lisp standard. Most Lisps
  425. provide a function ROOM which provides human-readable information about the
  426. state of storage usage. In many Lisps, (gc) invokes an ephemeral garbage
  427. collection, and (gc t) a full garbage collection.
  428.  
  429. ----------------------------------------------------------------
  430. [2-11] How do I save an executable image of my loaded Lisp system?
  431.        How do I run a Unix command in my Lisp?
  432.        How do I get the current directory name from within a Lisp program?
  433.  
  434. There is no standard for dumping a Lisp image. Here are the
  435. commands from some lisp implementations:
  436.    Lucid:               DISKSAVE
  437.    Symbolics:           Save World  [CP command]
  438.    CMU CL:              SAVE-LISP
  439.    Franz Allegro:       EXCL:DUMPLISP (documented)
  440.                         SAVE-IMAGE (undocumented)
  441.    Medley:              IL:SYSOUT or IL:MAKESYS
  442.    MCL:                 SAVE-APPLICATION <pathname>
  443.                           &key :toplevel-function  :creator :excise-compiler
  444.                           :size :resources :init-file :clear-clos-caches
  445.    KCL:                 (si:save-system "saved_kcl")
  446.  
  447. There is no standard for running a Unix shell command from Lisp,
  448. especially since not all Lisps run on top of Unix. Here are the
  449. commands from some Lisp implementations:
  450.    Allegro:             EXCL:RUN-SHELL-COMMAND
  451.    Lucid:               RUN-PROGRAM (name
  452.                                      &key input output
  453.                                           error-output (wait t) arguments
  454.                                           (if-input-does-not-exist :error)
  455.                                           (if-output-exists :error)
  456.                                           (if-error-output-exists :error))
  457.    KCL:                 SYSTEM
  458.                         For example, (system "ls -l").
  459.                         You can also try RUN-PROCESS and EXCLP, but they
  460.                         don't work with all versions of KCL.
  461.  
  462. There's no standard function for finding the current directory from
  463. within a Lisp program, since not all Lisp environments have the
  464. concept of a current directory. Here are the commands from some Lisp
  465. implementations:
  466.    Lucid:               working-directory (which is also SETFable)
  467.                         pwd and cd also work
  468.    Allegro:             current-directory (use excl:chdir to change it)
  469.    CMU CL:              default-directory
  470.  
  471. Allegro also uses the variable *default-pathname-defaults* to resolve
  472. relative pathnames, maintaining it as the current working directory.
  473. So evaluating (truename "./") in Allegro (and on certain other
  474. systems) will return a pathname for the current directory. Likewise,
  475. in some VMS systems evaluating (truename "[]") will return a pathname
  476. for the current directory.
  477.  
  478. ----------------------------------------------------------------
  479. [2-12] I'm porting some code from a Symbolics Lisp machine to some
  480.        other platform, and there are strange characters in the code.
  481.        What do they mean?
  482.  
  483. The Symbolics Zetalisp character set includes the following
  484. characters not present in other Lisps:
  485.    ^]      >=      greater than or equal to
  486.    ^\      <=      less than or equal to
  487.    ^Z      !=      not equal to
  488.    ^^      ==      equivalent to
  489.    ^E      not
  490.    ^G      pi
  491.    ^L      +/-     plus/minus
  492.    ^H      lambda
  493.    ^F      epsilon
  494.    ^W      <-->    left/right arrow
  495.    ^X      <--     left arrow
  496.    ^Y      -->     right arrow
  497.  
  498. Other special characters to look out for are the font-change characters,
  499. which are represented as a ^F followed by a digit or asterisk. A digit
  500. means to push font #N onto the stack; an asterisk means to pop the most
  501. recent font from the stack. You can clean up the code by replacing "\^F."
  502. with "".
  503.  
  504. ----------------------------------------------------------------
  505. [2-13] History: Where did Lisp come from?
  506.  
  507. John McCarthy developed the basics behind Lisp during the 1956 Dartmouth
  508. Summer Research Project on Artificial Intelligence.  He intended it as an
  509. algebraic LISt Processing (hence the name) language for artificial
  510. intelligence work. Early implementations included the IBM 704, the IBM
  511. 7090, the DEC PDP-1, the DEC PDP-6 and the DEC PDP-10. The PDP-6 and
  512. PDP-10 had 18-bit addresses and 36-bit words, allowing a CONS cell to
  513. be stored in one word, with single instructions to extract the CAR and
  514. CDR parts. The early PDP machines had a small address space, which
  515. limited the size of Lisp programs.
  516.  
  517. Milestones in the development of Lisp:
  518.  
  519.    1956            Dartmouth Summer Research Project on AI.
  520.  
  521.    1960-65         Lisp1.5 is the primary dialect of Lisp.
  522.  
  523.    1964-           Development of BBNLisp at BBN.
  524.  
  525.    late 60s        Lisp1.5 diverges into two main dialects:
  526.                    Interlisp (originally BBNLisp) and MacLisp.
  527.  
  528.    early 70s       Development of special-purpose computers known as Lisp
  529.                    Machines, designed specificly to run Lisp programs.
  530.                    Xerox D-series Lisp Machines run Interlisp-D.
  531.                    Early MIT Lisp Machines run Lisp Machine Lisp
  532.                    (an extension of MacLisp).
  533.